using System;
using Storage.Core;

namespace Storage.Client
{
	internal static class StorageQueryFactory
	{
		public static AddOrUpdateQuery CreateAddOrUpdateQuery<T>(IEntity<T> entity, ISerializer<T> serializer)
		{
			return new AddOrUpdateQuery(entity.ToPlainEntity(serializer));
		}

		public static ReadByIdQuery CreateReadByIdQuery(Guid id)
		{
			return new ReadByIdQuery(id);
		}

		public static ReadByTypeQuery CreateReadByTypeQuery<T>()
		{
			return new ReadByTypeQuery(typeof(T).ToString());
		}

		public static DeleteQuery CreateDeleteQuery(Guid id)
		{
			return new DeleteQuery(id);
		}
	}
}